package com.xinlianshiye.im.dao;

import com.xinlianshiye.im.dao.custom.FriendDaoCustom;
import com.xinlianshiye.im.bean.Friend;
import com.xinlianshiye.im.bean.User;
import org.springframework.data.jpa.repository.JpaRepository;

public interface FriendDao extends JpaRepository<Friend,Integer> , FriendDaoCustom {

    // 判断申请好友是否已经是好友
    Boolean existsByUserAndFriend(User user, User friend);
    /**
     * @Author zw
     * @Description  删除用户的好友
     * @Date 16:37 2019/8/28
     * @Param
     **/
    Integer deleteByUserIdAndFriendId(Integer userId,Integer friendId);

    Friend findByUserIdAndFriendId(Integer userId, Integer friendId);
}
